Class HCC.DT.HCC2HL72.ProInfoUpd Extends Ens.DataTransformDTL [ DependsOn = (EnsLib.EDI.XML.Document, EnsLib.HL7.Message) ]
{

Parameter IGNOREMISSINGSOURCE = 1;

Parameter REPORTERRORS = 1;

Parameter TREATEMPTYREPEATINGFIELDASNULL = 0;

XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='EnsLib.EDI.XML.Document' targetClass='EnsLib.HL7.Message' sourceDocType='PRPM_IN301010UV01:PRPM_IN301010UV01' targetDocType='2.5.1:PMU_B01' create='new' language='objectscript' >
<assign value='source.{id().extension}' property='target.{MSH:MessageControlID}' action='set' />
<assign value='source.{creationTime().value}' property='target.{MSH:DateTimeOfMessage.Time}' action='set' />
<assign value='"PMU"' property='target.{MSH:MessageType.MessageCode}' action='set' />
<assign value='"B01"' property='target.{MSH:MessageType.TriggerEvent}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().healthCarePrincipalPerson.asAffiliate().choice.affiliatedPrincipalOrganization.name},"//s:item/s:part/@value")' property='target.{AFF(1):ProfessionalOrganization.OrganizationName}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().healthCarePrincipalPerson.asAffiliate().choice.affiliatedPrincipalOrganization.id.item().extension}' property='target.{AFF():ProfessionalOrganization.IDNumber}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().id().item().extension}' property='target.{PRA(1):PractitionerIDNumbers(1)}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().code().code}' property='target.{PRA():PractitionerGroup(1).Identifier}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().code().displayName.value}' property='target.{PRA():PractitionerGroup().Text}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().healthCarePrincipalPerson.birthTime().value}' property='target.{STF:DateTimeofBirth}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().healthCarePrincipalPerson.name()},"//s:item/s:part/@value")' property='target.{STF:StaffName(1)}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().healthCarePrincipalPerson.administrativeGenderCode().displayName.value}' property='target.{STF:AdministrativeSex}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().healthCarePrincipalPerson.id.item().extension}' property='target.{STF:StaffIdentifierList(1).IDNumber}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().healthCarePrincipalPerson.idCategory.displayName.value}' property='target.{STF:StaffIdentifierList().IdentifierTypeCode}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().effectiveTime.low.value}' property='target.{STF:InstitutionActivationDate(1)}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().subject1().choice.healthCareProvider().effectiveTime.high.value}' property='target.{STF:InstitutionInactivationDate(1)}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().author().assignedEntity().id().item().extension}' property='target.{EVN:OperatorID(1).IDNumber}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().registrationRequest().author().assignedEntity().choice.assignedPerson.name()},"//s:item/s:part/@value")' property='target.{EVN:OperatorID().FamilyName}' action='set' />
<assign value='source.{controlActProcess().subject().registrationRequest().author().assignedEntity().representedOrganization.id().item().extension}' property='target.{EVN:EventFacility.UniversalID}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().registrationRequest().author().assignedEntity().representedOrganization.name},"//s:item/s:part/@value")' property='target.{EVN:EventFacility.UniversalIDType}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().registrationRequest().author().assignedEntity().representedOrganization.contactParty().contactPerson.name()},"//s:item/s:part/@value")' property='target.{EVN:EventFacility.NamespaceID}' action='set' />
</transform>
}

}
